package com.kaia.shoebox.db.dao;

public enum Importance {

	// ------------------------------------------------------------------
	// Constants
	// ------------------------------------------------------------------

	HIGH(0), MEDIUM_HIGH(1), MEDIUM(2), LOW(3), DONE(4);

	// ------------------------------------------------------------------
	// Attributes
	// ------------------------------------------------------------------

	private final int impNum;

	// ------------------------------------------------------------------
	// Constructor
	// ------------------------------------------------------------------

	private Importance(int num) {
		impNum = num;
	}

	// ------------------------------------------------------------------
	// Methods
	// ------------------------------------------------------------------

	public int getImportanceNumber() {
		return impNum;
	}

	public int compare(Importance other) {
		if (impNum < other.getImportanceNumber()) {
			return -1;
		} else if (impNum > other.getImportanceNumber()) {
			return 1;
		} else {
			return 0;
		}
	}

	// ------------------------------------------------------------------
	// Static Methods
	// ------------------------------------------------------------------

	public static Importance getImprtanceByNumber(int number) {

		Importance ret = null;
		switch (number) {
		case 0:
			ret = HIGH;
			break;
		case 1:
			ret = MEDIUM_HIGH;
			break;
		case 2:
			ret = MEDIUM;
			break;
		case 3:
			ret = LOW;
			break;
		case 4:
			ret = DONE;
		}
		return ret;
	}
}
